﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Copad.BusinessCard.DAL;
using Copad.BusinessCard.Model;

namespace Copad.BusinessCard.BLL
{
    public class CardRemarkBLL : BLL<CardRemark>
    {
        public OperationResult Validate(CardRemark remark)
        {
            OperationResult result = new OperationResult();
            if (string.IsNullOrEmpty(remark.Remark))
            {
                result.Successful = false;
                result.Append("&nbsp;&nbsp;备注不能为空！<br/>");
            }
            if (remark.Remark.Length > 512)
            {
                result.Successful = false;
                result.Append("&nbsp;&nbsp;备注长度不能超过512！<br/>");
            }
            return result;
        }

        public void Delete(IList<long> ids)
        {
            dataBase.Delete<CardRemark>(x => ids.Contains(x.ID));
        }
    }
}
